import request from '/@/utils/request'
import { IAddRole } from '@/entity/organizationalStructureBean'

export const defaultAddRoleData: IAddRole = {
  rName: '',
  description: ''
}

// 获取所有角色列表
export const getRoleList = (params: any): any =>
  request({
    url: '/auth/getRoleList',
    method: 'get',
    params: params
  })

//获取角色拥有权限
export const getPermissionByRoleId = (params: any): any =>
  request({
    url: '/auth/getPermissionByRoleId',
    method: 'GET',
    params: params
  })

// 新增角色
export const addRole = (params: any): any =>
  request({
    url: '/auth/addRole',
    method: 'POST',
    params: params
  })

// 更新角色
export const updateRole = (params: any): any =>
  request({
    url: '/auth/updateRole',
    method: 'POST',
    params: params
  })

// 删除角色
export const delRole = (params: any): any =>
  request({
    url: '/auth/delRole',
    method: 'POST',
    params: params
  })